package com.srv.common;

import com.srv.persistence.PersistenceException;

import junit.framework.TestCase;

public class DataSourceManagerTestCase extends TestCase {
	
	public void testGetDataSource() throws PersistenceException{
		DataSourceManager dsm = DataSourceManager.get();
		assertNotNull(dsm.getDataSource("srv_def"));
	}
	
	public void testGetDataSourceNameByPID() throws PersistenceException{
		DataSourceManager dsm = DataSourceManager.get();
		String name = dsm.getDataSourceNameByPID(1);
		assertEquals("srv_database_0", name);
	}
	
	public void testGetDataSourceByPID() throws PersistenceException{
		DataSourceManager dsm = DataSourceManager.get();
		assertNotNull(dsm.getDataSource(1));
	}
	
	public void testCreateDataSourceMapping() throws PersistenceException{
		DataSourceManager dsm = DataSourceManager.get();
		int i = dsm.createDataSourceMapping(2);
		assertTrue(i >= 0);
	}
}
